@extends('layouts.home')
@section('title','金汇智谷——科技需求')
@section('content')
    <link rel="stylesheet" type="text/css" href="{{asset('resources/views/home/css/teachering.css')}}">

    <div class="fruitclass">
        <table>
            <tr>
                <td width="80">技术领域：</td>
                <td>
                    <ul id="domainList">
<script type="text/javascript">
var domainArr=['不限','信息技术','新材料','资源环境','纺织服装','食品营养','装备制造','交通运输','生物医药','现代农业','节能建筑','新能源','科技服务','IT互联网','其他'];
<?php $domain=isset($_GET['domain'])?$_GET['domain']:'不限'; ?>
var htmlstr='';
for(var i=0;i<domainArr.length;i++){
    if(domainArr[i]=='{{$domain}}'){
        htmlstr+='<li><a href="javascript:;" class="active">'+domainArr[i]+'</a></li>';
    }else{
        htmlstr+='<li><a href="javascript:;">'+domainArr[i]+'</a></li>';
    }
}
$('#domainList').html(htmlstr);
</script>
                    </ul>
                </td>
            </tr>
            <tr>
                <td width="80">交易价格：</td>
                <td>
                    <ul id="rateList">
<script type="text/javascript">
var rateArr=['不限','面议','1~5万','5~10万','10~20万','20~50万','50万以上'];
<?php $rate=isset($_GET['rate'])?$_GET['rate']:'不限'; ?>
var htmlstr='';
for(var i=0;i<rateArr.length;i++){
    if(rateArr[i]=='{{$rate}}'){
        htmlstr+='<li><a href="javascript:;" class="active">'+rateArr[i]+'</a></li>';
    }else{
        htmlstr+='<li><a href="javascript:;">'+rateArr[i]+'</a></li>';
    }
}
$('#rateList').html(htmlstr);
</script>
                    </ul>
                </td>
            </tr>
            <tr>
                <td width="80">合作方式：</td>
                <td>
                    <ul id="methodList">
<script type="text/javascript">
var methodArr=['不限','技术入股','技术许可','委托开发','合作开发','其他'];
<?php $method=isset($_GET['method'])?$_GET['method']:'不限'; ?>
var htmlstr='';
for(var i=0;i<methodArr.length;i++){
    if(methodArr[i]=='{{$method}}'){
        htmlstr+='<li><a href="javascript:;" class="active">'+methodArr[i]+'</a></li>';
    }else{
        htmlstr+='<li><a href="javascript:;">'+methodArr[i]+'</a></li>';
    }
}
$('#methodList').html(htmlstr);
</script>
                    </ul>
                </td>
            </tr>
        </table>
    </div>

<script type="text/javascript">
$(function(){
    $('#domainList li a').click(function(){
        $('#domainList li a').removeClass('active');
        $(this).addClass('active');
        location.href="{{url('need')}}?domain="+$(this).text()+"&rate={{$rate}}&method={{$method}}";
    })
        $('#rateList li a').click(function(){
            $('#rateList li a').removeClass('active');
            $(this).addClass('active');
            location.href="{{url('need')}}?domain={{$domain}}&rate="+$(this).text()+"&method={{$method}}";
        })
            $('#methodList li a').click(function(){
                $('#methodList li a').removeClass('active');
                $(this).addClass('active');
                location.href="{{url('need')}}?domain={{$domain}}&rate={{$rate}}&method="+$(this).text();
            })
})
</script>
    <div class="w100con bggrey">
        <div class="container help">
            <div class="row">
                <div class="col-md-12">
                    <div class="help-con clearfix">
                            <div class="helpleft bgwhite">
                            <div class="creadf bggrey">
                              <a href="{{url('admin/need')}}"><button type="button" class="btn btn-danger btn-lg btn-block">我要发布需求</button></a>
                            </div>
                            <dl class="helpdl">
                                    <dt class="f20 fgrey">点击排行</dt>
                                    <?php $i=1; ?>
                                    @foreach($neeview as $v)
                                    <dd><span class="block" style="background:#3BC9CB;"><?php echo $i; ?></span><a href="{{url('need/'.$v->nee_id)}}" title="{{$v->nee_name}}">{{$v->nee_name}}</a></dd>
                                    <?php $i++; ?>
                                    @endforeach
                            </dl>
                            <dl class="helpdl">
                                    <dt class="f20 fgrey">最新文章</dt>
                                    <?php $i=1; ?>
                                    @foreach($neetime as $t)
                                    <dd><span class="block" style="background:#3BC9CB;"><?php echo $i; ?></span><a href="{{url('need/'.$t->nee_id)}}" title="{{$t->nee_name}}">{{$t->nee_name}}</a></dd>
                                    <?php $i++; ?>
                                    @endforeach
                            </dl>
                </div>	
                    <div class="helpright bgwhite">
            <h1 class="title">科技需求&nbsp;&nbsp;&nbsp;<small>信息列表</small></h1>

            <ul id="publicContent" style="min-height:500px;">
                @foreach($needata as $n)
                <li>					
                    <span class="time">{{date('Y-m-d',$n->nee_time)}}</span>
                    <p>
                        <a href="{{url('need/'.$n->nee_id)}}" title="{{$n->nee_name}}">{{$n->nee_name}}</a>						
                    </p>
                    <p>
                        <span>技术领域：{{$n->nee_class}}</span>
                        <span>交易价格：{{$n->nee_rate}}</span>
                        <span>合作方式：{{$n->nee_method}}</span>
                    </p>
                </li>
                @endforeach
            </ul>
            <div class="page">
                {{$needata->links()}}
            </div>

          </div>
                </div>
                </div>
            </div>
        </div>
    </div>	

@endsection
